package learn.letcode.tree;

/**
 * 叶子节点
 * @param <T>
 */
public class LeafNode<T> extends Node {

    public LeafNode() {
    }

    public LeafNode(T nodeEntity) {
        super();
        super.nodeEntity = nodeEntity;
    }

    public void display(Node<T> treeNode, int depth) {
        StringBuilder sb = new StringBuilder("");
        for(int i = 0; i < depth; i++) {
            sb.append("-");
        }
        System.out.println(new String(sb) + treeNode.getNodeEntity().toString());
    }

}
